/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author maynoigi
 */
@Entity
@Table(name = "Solution")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Solution.findAll", query = "SELECT s FROM Solution s"),
    @NamedQuery(name = "Solution.findBySolutionID", query = "SELECT s FROM Solution s WHERE s.solutionID = :solutionID"),
    @NamedQuery(name = "Solution.findBySolutionContent", query = "SELECT s FROM Solution s WHERE s.solutionContent = :solutionContent"),
    @NamedQuery(name = "Solution.findBySolutionCreateDate", query = "SELECT s FROM Solution s WHERE s.solutionCreateDate = :solutionCreateDate")})
public class Solution implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(name = "SolutionID")
    private Integer solutionID;
    @Size(max = 2147483647)
    @Column(name = "SolutionContent")
    private String solutionContent;
    @Column(name = "SolutionCreateDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date solutionCreateDate;
    @JoinColumn(name = "MembersID", referencedColumnName = "MembersID")
    @ManyToOne
    private Members membersID;
    @JoinColumn(name = "ComplaintID", referencedColumnName = "ComplaintID")
    @ManyToOne
    private Complaint complaintID;

    public Solution() {
    }

    public Solution(Integer solutionID) {
        this.solutionID = solutionID;
    }

    public Integer getSolutionID() {
        return solutionID;
    }

    public void setSolutionID(Integer solutionID) {
        this.solutionID = solutionID;
    }

    public String getSolutionContent() {
        return solutionContent;
    }

    public void setSolutionContent(String solutionContent) {
        this.solutionContent = solutionContent;
    }

    public Date getSolutionCreateDate() {
        return solutionCreateDate;
    }

    public void setSolutionCreateDate(Date solutionCreateDate) {
        this.solutionCreateDate = solutionCreateDate;
    }

    public Members getMembersID() {
        return membersID;
    }

    public void setMembersID(Members membersID) {
        this.membersID = membersID;
    }

    public Complaint getComplaintID() {
        return complaintID;
    }

    public void setComplaintID(Complaint complaintID) {
        this.complaintID = complaintID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (solutionID != null ? solutionID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Solution)) {
            return false;
        }
        Solution other = (Solution) object;
        if ((this.solutionID == null && other.solutionID != null) || (this.solutionID != null && !this.solutionID.equals(other.solutionID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Solution[ solutionID=" + solutionID + " ]";
    }
    
}
